package com.jomoo.css.common.util.service;


import com.jomoo.css.common.util.security.AuthenticationUser;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;


public interface AuthenticationUserService extends UserDetailsService {


    @Override
    @Cacheable( value="sysuaa_users", key = "'getByUsername:'+#p0")
    AuthenticationUser loadUserByUsername(String username);

    @Cacheable( value="sysuaa_users", key = "'getByUsername:'+#p0")
    AuthenticationUser loadUserByLogin(String username,String password);

    @CacheEvict( value="sysuaa_users", key = "'getByUsername:'+#p0")
    void resetByUsername(String username);

    //
    AuthenticationUser loadUserByTelephone(String telephone,String captcha,String userCode);

    List<AuthenticationUser> loadUserByTelephones(String telephone, String captcha);

    //
    AuthenticationUser loadUserByCode1(String code);

}
